home *** CD-ROM | disk | FTP | other *** search
- Path: rap.SanDiegoCA.ATTGIS.COM!es013!jbc
- From: jbc@ElSegundoCA.ATTGIS.COM (Jim Chapman)
- Newsgroups: comp.lang.c++
- Subject: Re: class defined after use?
- Date: 13 Jan 1996 01:37:19 GMT
- Organization: AT&T Global Information Solutions
- Distribution: world
- Message-ID: <4d72cf$gig@rap.SanDiegoCA.ATTGIS.COM>
- References: <4d4l4a$ecg@news1.wolfe.net>
- Reply-To: jbc@ElSegundoCA.ATTGIS.COM
- NNTP-Posting-Host: es013.elsegundoca.attgis.com
-
- In article ecg@news1.wolfe.net, mgooding@wolfe.net (Joshua Gooding) writes:
- > Is it possible to have a class with a pointer to a variable of another
- > type that is defined later int he file?
-
-
- Absolutely. Use a forward class declaration, e.g.
-
- class Foo; // forward declaration of Foo
-
- class Bar {
- Foo* x;
- };
-
- class Bar { ... }; // real definition of Foo
- ---
- ==== AT&T | Jim Chapman |
- =--=== Global | Multimedia Projects | jbc@ElSegundoCA.ATTGIS.COM
- =--=== Information | 100 N. Sepulveda Blvd. | Voice: (310) 524-6747
- ==== Solutions | El Segundo, CA 90245 | FAX: (310) 524-5515
-
-